# script0902.py - Populate the Record High Temps (F) Dictionary
#               - Create a Celcius Version of the Dictionary
# Author: Blum and Bresnahan
# Date:  May
################################################################
#
# Populate dictionary for Record High Temps (F) during May in Indianapolis
print()
print("Enter the record high temps (F) for May in Indianapolis...")
#
may_high_temp={}		    #Create empty dictionary
#
for may_date in range(1, 31 + 1):  #Loop to enter temps
#
	# Obtain record high temp for date
	prompt="Record high for May " + str(may_date) + ": "
	record_high=int(input(prompt))
        #
	# Put element in dictionary
	may_high_temp[may_date]=record_high
#
###########################################################
# Create the Celcius verion of the Dictionary
#
may_high_temp_c={}			#Create empty dictionary
#
may_high_temp_c.update(may_high_temp)	#Create deep copy
#
date_keys=may_high_temp_c.keys()        #Obtain list of element keys
#
for may_date in date_keys:         #Loop to convert F to C
#
	high_temp_f=may_high_temp_c[may_date]  #Obtain Fahrenheit
#
	high_temp_c=(high_temp_f - 32) * 5 / 9 #Convert to Celcius
#
	may_high_temp_c[may_date]=high_temp_c  #Update dictionary
#
###########################################################
# Display Record High Temps Dictionaries (Both F & C)
#
print()
print("Record High Temperatures in Indianapolis during Race Month")
#
date_keys=may_high_temp.keys()   #Obtain list of element keys
#
for may_date in date_keys:       #Loop to display key/value pairs
	print("May", may_date, end = ': ')
	print(may_high_temp[may_date],"F", end = '\t')
	print("{0:.1f}".format(may_high_temp_c[may_date]),"C")
#
######################################################### 
